package com.hkbigdata.springbootmybatis.mapper;

import com.hkbigdata.springbootmybatis.bean.Department;
import org.apache.ibatis.annotations.*;

/**
 * @author liuanbo
 * @creat 2024-10-30-15:14
 * @see 2194550857@qq.com
 */
@Mapper
public interface DepartmentMapper {

    @Select("select * from department where id = #{id}")
    public Department getDepartmentById(int id);

    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into department (departmentName) values (#{departmentName})")
    public int addDepartment(Department department);

    @Delete("delete from department where id = #{id}")
    public int deleteDepartmentById(int id);

    @Update("update department set departmentName=#{departmentName} where id = #{id}")
    public int updateDepartment(Department department);


}
